// 引入 request 文件--去接乘客页面和订单页面js
import request from './index.js'
//接乘客获得订单信息
export const getOrder = (id) => {
	return request({
		url: '/order-service/order/selectWaitingOrderList',
		method: 'get',
		data: {
			driverId: id
		}
	})
}

//接乘客获得订单信息
export const confirmStart = (id) => {
	return request({
		url: '/order-service/order/confirmStart',
		method: 'get',
		data: {
			driverId: id
		}
	})
}
//开始导航，前往目的地
export const confirmEnd = (id) => {
	return request({
		url: '/order-service/order/confirmEnd',
		method: 'get',
		data: {
			driverId: id
		}
	})
}
//获得本次订单的乘客信息
export const getUser = (id) => {
	return request({
		url: '/user-service/user/getUser',
		method: 'get',
		data: {
			userId: id
		}
	})
}
//获得该司机的全部订单-selectAllOrderList
export const getAllOrder = (id) => {
	return request({
		url: '/order-service/order/selectAllOrderList',
		method: 'get',
		data: {
			driverId: id
		}
	})
}
//获得该司机待接单的订单
export const getPendingOrder = (id) => {
	return request({
		url: '/order-service/order/selectSystemOrderList',
		method: 'get',
		data: {
			driverId: id
		}
	})
}
//获得该司机进行中的订单
export const getProgressOrder = (id) => {
	return request({
		url: '/order-service/order/selectOngoingOrderList',
		method: 'get',
		data: {
			driverId: id
		}
	})
}
//获得该司机完成的全部订单
export const getFinishOrder = (id) => {
	return request({
		url: '/order-service/order/selectCompletedOrderList',
		method: 'get',
		data: {
			driverId: id
		}
	})
}
//司机拒单
export const rejectOrders = (id) => {
	return request({
		url: '/order-service/order/rejectOrder',
		method: 'put',
		data: {
			driverId: id
		}
	})
}